/*
RAT dcom v0.5.0, Refractor2 Archive Tool decompressor

Copyright (C) 2002
					Tonto Rostenfaunt		tonto@linuxmail.org
					Blackjap McGee			blackjap@hawaii.rr.com

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

*/

int extract(FILE *, char *, unsigned long, unsigned long, unsigned char*, unsigned char*);
int _dcom(unsigned char *,unsigned char *, unsigned int, unsigned int);

struct data_header {
        unsigned long csize;            //compressed size exluding header data
        unsigned long ucsize;           //uncompressed size
        unsigned long doffset;          //offset into data to restart at (for mult segments)
};
typedef struct data_header DHEAD;

#define _DEBUG_ 1

#ifdef _DEBUG_
#define DBUG(ID) (printf("  %03u:%03d: CB1=%08X\tCB2=%08X\tCBC1=%08X\tSB OFF: %X\t OB OFF: %X\t OB2OFF: %X\n",ID,__LINE__,(cb1>0xffff?cb1-(unsigned int)obuff:cb1),cb2,cbc1,sb1-sbuff,ob1-obuff,ob2-obuff));
#define OOB  printf("  OOB:%d: CB1=%08X\tCB2=%08X\tCBC1=%08X\n", __LINE__,cb1,cb2,cbc1);
#define POB  for(pobc=obuff;*pobc!=0x00000000;pobc++) { printf("%08X ",htonl(*pobc)); } printf("\n");
#define PSB  for(pobc=sb1;*pobc!=0x00000000;pobc++) { printf("%08X ",htonl(*pobc)); } printf("\n");
unsigned int *pobc;
#else
#define DBUG(ID)
#define OOB
#define POB
#define PSB
#endif


